<template>
	<view class="my-store-info">
		<view class="store-box">
			<view class="title">*银行卡信息</view>
			<view class="store-form">
				<u-cell-group>
					<u-cell title="账户开户名">
						<u--input placeholder="请输入内容" border="none" v-model="storeInfo.accountName"
							slot="value"></u--input>
					</u-cell>
					<u-cell title="开户行" arrow-direction="right" :isLink="true" @click="openBank">
						<text slot="value" class="u-slot-value">{{mainBankName}}</text>
					</u-cell>
					<u-cell title="支行名称" arrow-direction="right" :isLink="true" @click="openSubBank">
						<text slot="value" class="u-slot-value">{{storeInfo.bankName}}</text>
					</u-cell>
					<u-cell title="开户许可证" v-if="parameter.merchantBusinessType!=3">
						<u-upload :fileList="facadeList" @afterRead="afterReadfacade" @delete="deletePicfacade" name="1"
							slot="value" :multiple="false" :maxCount="1"></u-upload>
					</u-cell>
					<u-cell title="结算卡银行所在省" arrow-direction="right" :isLink="true" @click="openProv">
						<text slot="value" class="u-slot-value">{{ProvName}}</text>
					</u-cell>
					<u-cell title="结算卡银行所在市" arrow-direction="right" :isLink="true" @click="openCity">
						<text slot="value" class="u-slot-value">{{cityName}}</text>
					</u-cell>
					<u-cell title="银行卡正面照">
						<u-upload :fileList="BankcardList" @afterRead="afterReadBankcard" @delete="deletePicBankcard"
							name="1" slot="value" :multiple="false" :maxCount="1"></u-upload>
					</u-cell>
					<u-cell title="账户开户号">
						<u--input slot="value" placeholder="账户开户号" fontSize="14px" border="none"
							v-model="storeInfo.accountNo"></u--input>
					</u-cell>
					<u-cell title="预留手机号">
						<u--input slot="value" placeholder="预留手机号" fontSize="14px" border="none"
							v-model="storeInfo.accountPhone"></u--input>
					</u-cell>
					<u-cell title="存款账户编号或核准号">
						<u--input slot="value" placeholder="存款账户编号或核准号" fontSize="14px" border="none"
							v-model="storeInfo.openLicenceNo"></u--input>
					</u-cell>
					
				</u-cell-group>
			</view>
		</view>
		<view class="store-box">
			<view class="title">*食品卫生许可证（食品相关行业必须上传）</view>
			<view class="store-form">
				<u-cell-group>
					<u-cell title="许可证">
						<u-upload :fileList="licenseList" @afterRead="afterReadLicense" @delete="deletePicLicense"
							name="2" slot="value" :multiple="false" :maxCount="1"></u-upload>
					</u-cell>

				</u-cell-group>
			</view>
		</view>
		<view class="store-box">
			<view class="title">*补充材料(图片)</view>
			<view class="store-form">
				<u-cell-group>
					<u-cell title="补充图片">
						<u-upload :fileList="suppleList" @afterRead="afterReadSupple" @delete="deletePicSupple" name="3"
							slot="value" :multiple="true" :maxCount="2"></u-upload>
					</u-cell>

				</u-cell-group>
			</view>
		</view>
		<view class="store-box">
			<view class="title">*补充材料(视频)</view>
			<view class="store-form">
				<u-cell-group>
					<u-cell title="补充视频">
						<u-upload :fileList="suppleVideoList" @afterRead="afterReadVideo" @delete="deletePicVideo" name="4"
							slot="value" :multiple="false" :maxCount="1" accept="video" :maxDuration="15"></u-upload>
					</u-cell>
		
				</u-cell-group>
			</view>
		</view>
		<view class="agreen">
			<view class="check">
				<u-checkbox-group @change="changeEvent">
					<u-checkbox v-model="checked" shape="circle" name="1">
					</u-checkbox>
				</u-checkbox-group>
			</view>
			<view class="word">
				<view class="text">阅读并同意</view>
				<view class="textred" @tap="jumpTo('/pages/storeManage/store-agreement')">《商家协议》</view>
				<view class="text">和</view>
				<view class="textred" @tap="jumpTo('/pages/user/agreement')">《特约商户支付服务协议》</view>
			</view>

		</view>
		<u-popup :show="showList" :closeOnClickOverlay="true" @close="closeType" :safeAreaInsetTop="true"
			:closeable="true" mode="bottom">
			<view class="tylist">
				<scroll-view :scroll-y="true" class="scroll-Y" :style="{height:screenHeight*0.7+'px'}">
					<view class="li" v-for="(item,index) in bankList" :key="index" @tap="selectType(item)">
						{{item.bankName}}
					</view>
				</scroll-view>

			</view>
		</u-popup>
		<u-popup :show="showPop" :closeOnClickOverlay="true" @close="closePop" :safeAreaInsetTop="true"
			:closeable="true" mode="bottom">
			<view class="bankbox" :style="styleObj">
				<u-search placeholder="请输入关键字" v-model="keyword" :showAction="true" @search="searchBank"
					@custom="searchBank"></u-search>
				<view class="tylist">
					<scroll-view :scroll-y="true" class="scroll-Y" :style="{height:screenHeight*0.6+'px'}">
						<view class="li" v-for="(item,index) in subBankList" :key="index" @tap="selectBank(item)">
							{{item.bankName}}
						</view>
					</scroll-view>
				</view>
			</view>

		</u-popup>
		<u-popup :show="showProvList" :closeOnClickOverlay="true" @close="closeProv" :safeAreaInsetTop="true"
			:closeable="true" mode="bottom">
			<view class="tylist">
				<scroll-view :scroll-y="true" class="scroll-Y" :style="{height:screenHeight*0.7+'px'}">
					<view class="li" v-for="(item,index) in ProvList" :key="index" @tap="selectProv(item)">
						{{item.areaName}}
					</view>
				</scroll-view>
		
			</view>
		</u-popup>
		<u-popup :show="showCityList" :closeOnClickOverlay="true" @close="closeCity" :safeAreaInsetTop="true"
			:closeable="true" mode="bottom">
			<view class="tylist">
				<scroll-view :scroll-y="true" class="scroll-Y" :style="{height:screenHeight*0.7+'px'}">
					<view class="li" v-for="(item,index) in CityList" :key="index" @tap="selectCity(item)">
						{{item.areaName}}
					</view>
				</scroll-view>
		
			</view>
		</u-popup>
		<view class="btn" @tap="creat()">立即创建店铺</view>
	</view>
</template>

<script>
	const app = getApp();
	const globalData = app.globalData;
	const apiUrl = globalData.wxApi;
	const wxImg = globalData.wxImg;
	let deviceInfo = {};
	uni.getSystemInfo({
		success: res => {
			console.log(res)
			deviceInfo = res;
		}
	});

	import {
		getStoreData,
		dealNum,
		httpPost,
		httpGet,
		bdMapToTxMap,
		txMapToBdMap,
	} from "@/utils/http.js";
	import mpMixin from "@/uni_modules/uview-ui/libs/mixin/mpMixin";
	const pic1 = require(`@/img/my/my1.png`);
	import popupActivity from "./component/popupActivity";
	export default {
		data() {
			return {
				wxImg,
				apiUrl,
				dealNum,
				pic1,
				cityFlag: false,
				value: "",
				mode: "single",
				storeInfo: {
					accountNo: "", //入账银行卡卡号
					accountName: "", //入账银行卡开户名
					bankName: "", //入账银行卡开户支行
					bankNo: "", //开户支行联行号
					accountPhone: "",
					imgAdditionalA: "", //补充图片一
					imgAdditionalB: "", //补充图片二
					imgOpenPermits: "", //开户许可证
					imgBankcardA: "", //银行卡正面照
					videoAdditional:"",//补充视频
					openLicenceNo:"",//存款账户编号或核准号
					accountProvCode:"",//结算卡银行所在省编号
					accountCityCode:""//结算卡银行所在市编号
				},
				parameter: {},
				userInfo: {},
				facadeList: [],
				facadeImgs: [],
				licenseList: [],
				licenseImg: [],
				suppleList: [],
				suppleImgs: [],
				checked: false,
				showList: false,
				bankList: [],
				mainBankName: "",
				mainBankCode: "",
				keyword: "",
				showPop: false,
				subBankList: [],
				checkArr: [],
				screenHeight: deviceInfo.screenHeight,
				styleObj: {
					maxHeight: deviceInfo.screenHeight * 0.8 + 'px',
					overflow: 'auto'
				},
				scrollTop: 0,
				BankcardList: [],
				BankcardImgs: [],
				suppleVideoList:[],
				addVideoList:[],
				showCityList:false,
				showProvList:false,
				ProvList:[],
				CityList:[],
				ProvName:"",
				cityName:""
			};
		},
		components: {
			popupActivity,
		},
		onShow() {

		},
		onUnload() {

		},
		onLoad(options) {
			if (options && options.parameter) {
				this.parameter = JSON.parse(options.parameter);
				if(this.parameter.accountType==1){//对公
					this.storeInfo.accountName = this.parameter.merchantName;
				}
				if(this.parameter.accountType==2){//对私
					this.storeInfo.accountName = this.parameter.artifNm;
				}
				
			}
            this.getProvList();
			this.getStoreinfo();
			this.getMainBankList();
			
		},
		methods: {
			getStoreinfo() {
				let that = this;
				httpGet("/api/sellerstore/selfInfo")
					.then((res) => {
						if (res.data) {
							console.log(21)
							that.storeInfo.accountNo = res.data.accountNo; //入账银行卡卡号
							that.storeInfo.accountName = res.data.accountName; //入账银行卡开户名
							that.storeInfo.bankName = res.data.bankName; //入账银行卡开户支行
							that.storeInfo.bankNo = res.data.bankNo; //开户支行联行号
							that.storeInfo.accountPhone = res.data.accountPhone;
							that.storeInfo.imgAdditionalA = res.data.imgAdditionalA; //补充图片一
							that.storeInfo.imgAdditionalB = res.data.imgAdditionalB; //补充图片二
							that.storeInfo.imgOpenPermits = res.data.imgOpenPermits; //开户许可证
							that.storeInfo.imgBankcardA = res.data.imgBankcardA; //银行卡正面照
							that.storeInfo.videoAdditional = res.data.videoAdditional; //补充视频
							that.storeInfo.openLicenceNo=res.data.openLicenceNo;//基本存款账户编号或核准号
							that.storeInfo.accountProvCode=res.data.accountProvCode;
							that.storeInfo.accountCityCode=res.data.accountCityCode;
							that.getProvinceName(res.data.accountProvCode);
							that.getCityName(res.data.accountCityCode);
							console.log(9999,that.storeInfo);
							if(res.data.imgOpenPermits){
								let OpenPermitsArr = res.data.imgOpenPermits.split(','); //开户许可证
								if (OpenPermitsArr.length != 0) {
									that.facadeList = OpenPermitsArr.map((item) => {
										let obj = {};
										obj.url = wxImg + item;
										return obj
									});
								}
							}
							
							if(res.data.imgBankcardA){
								let BankcardArr = res.data.imgBankcardA.split(','); //银行卡正面
								if (BankcardArr.length != 0) {
									that.BankcardList = BankcardArr.map((item) => {
										let obj = {};
										obj.url = wxImg + item;
										return obj
									});
								}
							}
                            if(res.data.imgAdditionalA){
								let imgAdditionalArr = res.data.imgAdditionalA.split(','); //补充材料1
								let arr_one = [];
								console.log(2220, imgAdditionalArr)
								if (imgAdditionalArr.length != 0) {
									arr_one = imgAdditionalArr.map((item) => {
										let obj = {};
										obj.url = wxImg + item;
										return obj
									});
									that.suppleList[0] = arr_one[0];
								}
								console.log(21, that.suppleList)
							}
							if(res.data.imgAdditionalB){
								let imgAdditionalArr_two = res.data.imgAdditionalB.split(','); //补充材料2
								let arr_two = [];
								if (imgAdditionalArr_two.length != 0) {
									arr_two = imgAdditionalArr_two.map((item) => {
										let obj = {};
										obj.url = wxImg + item;
										return obj
									});
									that.suppleList[1] = arr_two[0];
								}
							}
							if(res.data.videoAdditional){
								let videoAdditionalArr_two = res.data.videoAdditional.split(','); //补充视频
								let arr_two = [];
								if (videoAdditionalArr_two.length != 0) {
									arr_two = videoAdditionalArr_two.map((item) => {
										let obj = {};
										obj.url = wxImg + item;
										return obj
									});
									that.suppleVideoList[0] = arr_two[0];
								}
							}

							
							
							
						}
					})
					.catch((e) => {});
			},
			getProvinceName(code){
				this.ProvList.map((item)=>{
					if(code==item.id){
						this.ProvName=item.areaName;
					}
				})
			},
			getCityName(code){
				let that = this;
				httpGet("/api/gbarea/listAreaByParentId/"+this.storeInfo.accountProvCode)
					.then((res) => {
						let cityList=res.data;
						cityList.map((item)=>{
							if(code==item.id){
								that.cityName=item.areaName;
							}
						})
					})
					.catch((e) => {});
			},
			async afterReadfacade(event) {
				//console.log(event)
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file);

				let fileListLen = this.facadeList.length;
				lists.map((item) => {
					this.facadeList.push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					//console.log('666',result)
					//this.facadeImgs.push(result[0].path+'/'+name);
					let item = this.facadeList[fileListLen]
					this.facadeList.splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
				//console.log(this.facadeList,this.facadeImgs);
				this.getFacadeImgList(this.facadeList);

			},
			deletePicfacade(event) {
				this.facadeList.splice(event.index, 1)
				this.getFacadeImgList(this.facadeList);
			},
			getFacadeImgList(list) {
				// console.log(list)
				if (list.length == 0) {
					this.facadeImgs = [];
				} else {
					this.facadeImgs = list.map((item) => {
						let imgUrl = item.url[0].path + '/' + item.url[0].name;
						return imgUrl
					})
				}
				this.storeInfo.imgOpenPermits = this.facadeImgs.join(",")
				// console.log(this.facadeImgs)
			},
			async afterReadrecep(event) {
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this.receptionList.length
				lists.map((item) => {
					this.receptionList.push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					let item = this.receptionList[fileListLen]
					this.receptionList.splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
				this.getReceptImgList(this.receptionList);
			},
			deletePicrecep(event) {
				this.receptionList.splice(event.index, 1);
				this.getReceptImgList(this.receptionList);
			},
			getReceptImgList(list) {
				// console.log(list)
				if (list.length == 0) {
					this.receptionImgs = [];
				} else {
					this.receptionImgs = list.map((item) => {
						let imgUrl = item.url[0].path + '/' + item.url[0].name;
						return imgUrl
					})
				}
			},


			async afterReadBankcard(event) {
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [].concat(event.file)
				let fileListLen = this.BankcardList.length
				lists.map((item) => {
					this.BankcardList.push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					let item = this.BankcardList[fileListLen]
					this.BankcardList.splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
				this.ocrIdentify(this.BankcardList[0].thumb)
				this.getBankcardImgList(this.BankcardList);
			},
			deletePicBankcard(event) {
				this.BankcardList.splice(event.index, 1);
				this.getBankcardImgList(this.BankcardList);
			},
			getBankcardImgList(list) {
				// console.log(list)
				if (list.length == 0) {
					this.BankcardImgs = [];
				} else {
					this.BankcardImgs = list.map((item) => {
						let imgUrl = item.url[0].path + '/' + item.url[0].name;
						return imgUrl
					})
				}
				this.storeInfo.imgBankcardA = this.BankcardImgs.join(",")
			},
			ocrIdentify(tempFilePath) {
				let that=this;
				const invokeRes = wx.serviceMarket.invokeService({
					service: 'wx79ac3de8be320b71',  //固定的不要动
					api: 'OcrAllInOne',             //固定的不要动
					data: {
						// 用 CDN 方法标记要上传并转换成 HTTP URL 的文件
						img_url: new wx.serviceMarket.CDN({
							type: 'filePath',
							filePath: tempFilePath,
						}),
						data_type: 3,        
						ocr_type: 2        // 1是身份证识别 2是银行卡  7是营业执照识别
					},
					success: function(res) {   //打印这个res  就是你想要的结果
					console.log(666,res)
						if(res.errMsg=="invokeService:ok"){
							that.storeInfo.accountNo=res.data.bankcard_res.number.text;
						}
					}
			
				})
			    
			
			},
			uploadFilePromise(url) {
				return new Promise((resolve, reject) => {
					let a = uni.uploadFile({
						url: this.apiUrl+'/api/upload/store',
						filePath: url,
						name: 'file',
						header: {
							"Authorization": uni.getStorageSync("token")
						},

						success: (res) => {
							let imgObj = JSON.parse(res.data);
							// console.log(363,imgObj)
							
							setTimeout(() => {
								resolve(imgObj.data)
							}, 1000)
						}
					});
				})
			},
			confirmStart(e) {
				console.log(e)
				this.storeInfo.licenseStart = e[0];
				this.showDateStart = false;
			},
			confirmEnd(e) {
				this.storeInfo.licenseEnd = e[0];
				this.showDateEnd = false;
			},
			async afterReadLicense(event) {
				console.log(event)
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [];
				lists[0] = event.file;

				let fileListLen = this.licenseList.length
				lists.map((item) => {
					this.licenseList.push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					let item = this.licenseList[fileListLen]
					this.licenseList.splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
				this.getLicenseImgList(this.licenseList);
			},
			deletePicLicense(event) {
				this.licenseList.splice(event.index, 1)
				this.getFacadeImgList(this.licenseList);
			},
			getLicenseImgList(list) {
				console.log(list)
				if (list.length == 0) {
					this.licenseImg = [];
				} else {
					this.licenseImg = list.map((item) => {
						let imgUrl = item.url[0].path + '/' + item.url[0].name;
						return imgUrl
					})
				}
			},
			async afterReadSupple(event) {
				// console.log(event)
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式

				let lists = [].concat(event.file);

				let fileListLen = this.suppleList.length
				lists.map((item) => {
					this.suppleList.push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				for (let i = 0; i < lists.length; i++) {
					const result = await this.uploadFilePromise(lists[i].url)
					let item = this.suppleList[fileListLen]
					this.suppleList.splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: result
					}))
					fileListLen++
				}
				this.getSuppleImgList(this.suppleList);
			},
			getSuppleImgList(list) {
				// console.log('补充', list)
				if (list.length == 0) {
					this.licenseImg = [];
				} else {
					this.licenseImg = list.map((item) => {
						let imgUrl = item.url[0].path + '/' + item.url[0].name;
						return imgUrl
					})
				}
				if (this.licenseImg.length == 1) {
					this.storeInfo.imgAdditionalA = this.licenseImg[0];
				}
				if (this.licenseImg.length == 2) {
					this.storeInfo.imgAdditionalB = this.licenseImg[1];
				}
				console.log('补充2', this.licenseImg, this.storeInfo.imgAdditionalA)

			},
			deletePicSupple(event) {
				this.suppleList.splice(event.index, 1)
				this.getSuppleImgList(this.suppleList);
			},
			getMainBankList() {
				let that = this;
				httpGet(`/api/banklist/listTop`)
					.then((res) => {
						console.log(res)
						if (res.success) {
							that.bankList = res.data;
						}
					})
					.catch((e) => {

					});
			},
			creat() {
				// console.log(this.checked)
				let that = this;
				if (!this.storeInfo.accountName) {
					wx.showToast({
						icon: "none",
						title: "请输入账户开户名"
					});
					return;
				} else if (!this.storeInfo.bankNo) {
					wx.showToast({
						icon: "none",
						title: "请选择开户行"
					});
					return;
				} else if (!this.storeInfo.bankName) {
					wx.showToast({
						icon: "none",
						title: "请选择支行名称"
					});
					return;
				} else if (!this.storeInfo.imgOpenPermits && this.parameter.merchantBusinessType != 3) {
					wx.showToast({
						icon: "none",
						title: "请上传开户许可证"
					});
					return;
				} else if (!this.storeInfo.accountNo) {
					wx.showToast({
						icon: "none",
						title: "请输入银行卡账号"
					});
					return;
				} else if (!this.storeInfo.accountPhone) {
					wx.showToast({
						icon: "none",
						title: "请输入银行预留手机号"
					});
					return;
				} else if (this.checkArr.length == 0) {
					wx.showToast({
						icon: "none",
						title: "请勾选商务协议"
					});
					return;
				}else if(!this.storeInfo.imgBankcardA){
					wx.showToast({
						icon: "none",
						title: "请上传银行卡正面照"
					});
					return;
				}
				if(this.parameter.accountType==1){
					if(!this.storeInfo.openLicenceNo){
						wx.showToast({
							icon: "none",
							title: "请填写基本存款账户编号或核准号"
						});
						return;
					}
				}

				let params = {
					...this.parameter,
					...this.storeInfo
				};
				// console.log(this.storeInfo, params);

				// uni.setStorageSync('accountInfo', this.storeInfo);
				httpPost("/api/sellerstore/applyUnion", params)
					.then((res) => {
						console.log(res)

						if (res.code == 0) {
							wx.showToast({
								icon: "none",
								title: "申请成功"
							});
							uni.switchTab({
								url: '/pages/index/home'
							});
						}
					})
					.catch((e) => {});
			},
			openBank() {
				this.showList = true;
			},
			selectType(data) {
				this.mainBankName = data.bankName;
				this.mainBankCode = data.bankNumber;
				this.showList = false;
			},
			openSubBank() {
				if (!this.mainBankCode) {
					wx.showToast({
						icon: "none",
						title: "请先选择开户行"
					});
					return;
				}
				this.showPop = true;

			},
			jumpTo(pageUrl) {
				uni.navigateTo({
					url: pageUrl
				});
			},
			closeType() {
				this.showList = false;
			},
			closePop() {
				this.showPop = false;
			},
			searchBank() {
				let that = this;
				httpPost("/api/banklist/querySubBank", {
						bankName: this.keyword,
						parentNumber: this.mainBankCode
					})
					.then((res) => {
						that.subBankList = res.data;
					})
					.catch((e) => {});
			},
			changeEvent(e) {
				// console.log(e)
				this.checkArr = e;
			},
			selectBank(data) {
				this.storeInfo.bankName = data.bankName; //入账银行卡开户支行
				this.storeInfo.bankNo = data.bankNumber;
				this.showPop = false;
			},
			async afterReadVideo(event) {
				// console.log('shipin1',event)
				// 当设置 multiple 为 true 时, file 为数组格式，否则为对象格式
				let lists = [];
				// lists[0] = event.file;
				// console.log(event.file)
				if(event.file.duration>15){
					wx.showToast({
						icon: "none",
						title: "视频不能超过15秒"
					});
					return
				}
			    lists.push(event.file)
				let fileListLen = this.suppleVideoList.length;
				
				lists.map((item) => {
					this.suppleVideoList.push({
						...item,
						status: 'uploading',
						message: '上传中'
					})
				})
				// console.log("shipin88",lists);
				for (let i = 0; i < lists.length; i++) {
					// console.log('1002',lists[i].url)
					const result = await this.uploadFilePromise(lists[i].url);
					const resultTwo=result[i].path+'/'+result[i].name;
					let item = this.suppleVideoList[fileListLen];
					// console.log('10063',result)
					this.suppleVideoList.splice(fileListLen, 1, Object.assign(item, {
						status: 'success',
						message: '',
						url: resultTwo
					}))
					fileListLen++
				}
				// console.log('shipin2',this.suppleVideoList)
				this.getVideoList(this.suppleVideoList);
			},
			getVideoList(list) {
				// console.log('shipin3',list)
				if (list.length == 0) {
					this.addVideoList = [];
				} else {
					this.addVideoList = list.map((item)=>{
						let v_url={url:item.url};
						return v_url
					});
					this.storeInfo.videoAdditional=this.addVideoList[0].url;
				}
				// console.log("shipin4",this.addVideoList);
				
				
			},
			deletePicVideo(event) {
				this.suppleVideoList.splice(event.index, 1)
				this.getVideoList(this.suppleVideoList);
			},
			openProv(){
				this.showProvList=true;
			},
			openCity(){
				this.showCityList=true;
			},
			closeProv(){
				this.showProvList=false;
			},
			closeCity(){
				this.showCityList=false;
			},
			async getProvList(){
				let that = this;
				await httpGet("/api/gbarea/listAreaByParentId/100000")
					.then((res) => {
						
						console.log(22)
						that.ProvList=res.data;
					})
					.catch((e) => {});
			},
			selectProv(data){
				let that = this;
				that.storeInfo.accountProvCode=data.id;
				that.ProvName=data.areaName;
				httpGet("/api/gbarea/listAreaByParentId/"+data.id)
					.then((res) => {
						
						that.CityList=res.data;
						that.showProvList=false;
					})
					.catch((e) => {});
			},
			selectCity(data){
				this.storeInfo.accountCityCode=data.id;
				this.cityName=data.areaName;
				this.showCityList=false;
			}


		},
	};
</script>

<style lang="scss">
	.my-store-info {
		background-color: #f4f5f7;
		padding-top: 20rpx;
		padding-bottom: 30rpx;
	}

	.store-box {
		width: 650rpx;
		margin-left: 30rpx;
		background-color: #fff;
		border-radius: 20rpx;
		margin-bottom: 20rpx;
		padding: 20rpx;

		.title {
			font-size: 28rpx;
			font-weight: bold;
			margin-bottom: 20rpx;
		}
	}

	/deep/ .u-cell__title-text {
		font-size: 28rpx;
	}

	/deep/ .u-input {
		flex: 2
	}

	.tylist {
		padding: 30rpx;

		.li {
			padding-top: 20rpx;
			padding-bottom: 20rpx;
			font-size: 28rpx;
			border-bottom: 2rpx solid #f4f5f7;
		}

		.li-one-box {

			.li-one-title {
				padding-top: 20rpx;
				padding-bottom: 20rpx;
				font-size: 28rpx;
				border-bottom: 2rpx solid #f4f5f7;
			}

			.li-two-box {
				margin-left: 20rpx;

				.li-two-title {
					padding-top: 20rpx;
					padding-bottom: 20rpx;
					font-size: 28rpx;
					border-bottom: 2rpx solid #f4f5f7;
				}

				.li-three-box {
					margin-left: 30rpx;

					.li-three-title {
						padding-top: 20rpx;
						padding-bottom: 20rpx;
						font-size: 28rpx;
						border-bottom: 2rpx solid #f4f5f7;
					}
				}
			}
		}
	}

	.btn {
		width: 690rpx;
		height: 100rpx;
		line-height: 100rpx;
		font-weight: bold;
		color: #fff;
		text-align: center;
		background: linear-gradient(to right, #3CBAF6, #56D1FC);
		margin-left: 30rpx;

	}

	.agreen {
		display: flex;
		flex-direction: row;
		justify-content: flex-start;
		font-size: 24rpx;
		margin-left: 30rpx;
		margin-right: 30rpx;
		margin-bottom: 70rpx;

		.word {
			display: flex;
			flex-direction: row;
			justify-content: flex-start;


			.textred {
				color: #FF4D46;
			}
		}
	}
</style>